#include<iostream>
#include<stdlib.h>
#include<string>
#include<signal.h>
#include<unistd.h>
int main(int argc, char* argv[])
{
    if(argc!= 3){
        std::cout<<"Usage: "<<argv[0]<<" signal pid"<<std::endl;
        ::exit(1);   
    }
    int sig = std::stoi(argv[1]);
    int pid = std::stoi(argv[2]);
    if(kill(pid, sig) == -1){
        std::cout<<"kill failed"<<std::endl;
        ::exit(1);
    }
    std::cout<<"kill "<<pid<<" with signal "<<sig<<" success"<<std::endl;
    return 0;
}